
PROJECT_NAME=${PWD##*/}

PACKAGE=$PROJECT_NAME"_source=1 pod package ${PROJECT_NAME}.podspec --force --exclude-deps --no-mangle"

echo $PACKAGE

eval $PACKAGE

ret=$?

if [ "$ret" -ne "0" ];then
	exit 1
fi

BINARY_DIR=$(ls -l | grep ^d | grep -o "${PROJECT_NAME}-.*")

mkdir -p $PROJECT_NAME/Products/

rm -rf  $PROJECT_NAME/Products/$PROJECT_NAME.framework

cp -R $BINARY_DIR/ios/$PROJECT_NAME.framework $PROJECT_NAME/Products/

rm -rf $BINARY_DIR

# rm -rf $PROJECT_NAME/Products/$PROJECT_NAME.framework/Versions/A/Resources/*
